home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92c.txt / 000080_icon-group-sender _Tue Nov 10 16:10:57 1992.msg < prev    next >
Internet Message Format  |  1993-01-04  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Fri, 13 Nov 1992 05:28:47 MST
  2. Date: 10 Nov 92 16:10:57 GMT
  3. From: agate!spool.mu.edu!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  4. Organization: University of Chicago Computing Organizations
  5. Subject: Re: file scanning
  6. Message-Id: <1992Nov10.161057.8331@midway.uchicago.edu>
  7. References: <199211092202.AA25256@optima.cs.arizona.edu>, <kelvin.721402278@kickapoo.cs.iastate.edu>
  8. Sender: icon-group-request@cs.arizona.edu
  9. To: icon-group@cs.arizona.edu
  10. Status: R
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12.  
  13. Several folks questioned whether what I really wanted was file scanning.
  14. The answer is "yes."  Icon is good for text and language processing, but
  15. to do this everything has to go through a tokenizing stage.  Icon's string
  16. scanning mechanism relies heavily on strings as chunks taken from files,
  17. broken up by newlines.  Sadly, we typically can't break up a file when
  18. tokenizing.  We have to treat it as a stream of characters.  If that stream
  19. could be scanned, then Icon would be quite useful for all stages of text
  20. and natural langauge processing.  Right now, it's okay, but you have to
  21. do one of two things:  a) use it like a poor man's C, or b) try to con-
  22. struct input so that it can be snipped off at each newline for the purposes
  23. of tokenizing.  Ironically, Icon itself cannot be tokenized in this way.
  24.  
  25. Incidentally, I'm not the first to suggest that scanning be generalized to
  26. files.  I recall reading this suggestion in an old Arizona tech report.
  27.  
  28. The real crux with file scanning, it would seem, is what to do when the
  29. file in question doesn't support backwards seeks.  Also, how in Icon could
  30. the stream be buffered in such a way as to store backtracking points? 
  31. Actually, I'd tend to say, "Don't buffer anything other than a few chars."
  32. After all, when tokenizing, normally nobody uses more than a few characters
  33. of pushback, and we normally use only one lookahead character.  If people
  34. want to seek back and forth through large files, then let them.  For things
  35. like pipes and other non-backwards-seekable objects, I would not care par-
  36. ticularly if there were simply an error message.
  37.  
  38. -- 
  39.  
  40.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  41.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  42.